package com.itheima.web.interceptor;

import com.itheima.domain.db.Admin;

/**
 * @author zsk
 * @create 2022-03-24-17:29
 */
public class AdminHolder {

    //线程绑定工具类
    private static final ThreadLocal<Admin> adminTL = new ThreadLocal<>();

    //像线程绑定Admin
    public static void set(Admin admin){
        adminTL.set(admin);
    }

    //获取Admin
    public static Admin get(){
        return adminTL.get();
    }

    //移除线程
    public static void remove(){
        adminTL.remove();
    }

}
